Fix misplaced #endif