Make checkpass reset the flags correctly