Added support for less than 7 tiles.