Scene gloo clean

Apply the same code as #307 applied to scenegraph branch.