Use a tile counter and fix bug in the caching regarding segment status checks