fixed typo (flags -> fl) and made the set of flags cleared by the assignment