Fix Z-Buffer bug