Fixed the ConvertFlagsToByte

It was returning DF instead of FF when all of the flags were set