Fix bug and Add some #define.