Fixing maze generation and tile matching