Window3d: cleaned up code.