fix: Validate modified flags only once (#173)