Fixed bug with non-square maps