You are right about the crash; I'll fix in and post an updated version of it. Also, I'll add the code that limits the camera rotation to the template.