Strip the flags only if they exist