Added missing #endif that was preventing compilation in vs2010