Improved preprocessor conditionals in main to prevent possibility of infinite recursion.