Fix bug related to zero thickness cells in 3D.