Fix minor bug with flags