Code clean up and removal of unwanted globals
Fix for iOS hang on video 3d setting