G in 3D and various bugfixes (v2)