Fixed issue with sorting the flags for the record coming out of the database.