Fix error in z position coordinates