Fixed 'get tile ID' function.