fix for compilation errors due to lack of #endif