More 3d fixes for issue #824