safety checks, and switchScene fixes