Fixed the crashes after camera rotation.