Flag setting fix and cutoff test fix