Flag cleanup