fixed segfault when loading non-square maps