Fix discovery of z-dimension