preprocessor directive logic fixes