Some minor reorganization of include statements and added a missing #define