G in 3D and various bugfixes