Use enum for set_flags function.