Fix tile generation