Fix terrain switching and wireframe mode.