Fixed infinite loop bug in json tiles