Bug in issue #22 solved!

Only forgot a -1 when accessing the pixel and  z-buffer array.