Fixed nil access crash where self.tileInstances[gid] == nil.