Protecting function with #if (and removing debug print)