Restore OpenGL context + some fixes