Fix build warnings and tmp handling
GL bugfixes

Update context mode and locking