Fixed a logic error in the new zbuffer logic.