fix #define bugs