Fixed preprocessor error messages and bugs