fixed some error stuff for flags