Fixed some order 3d layering bugs.