Bug fixes and optimisations to 3d world.