added more info about r->main->count to the debugging logs.