Make all-three-orientations code work for non-cube mazes.