Fix bug that used y instead of z for rendering