Cleanup of runtime_cnt and other things