Fixed bug in scene code