             for (var i:int = 0; i < token.text.length; i++)
             {
                 char = token.text.charAt(i);
-                if (setFlags.contains(char))
+                if (setFlags[char])
                 {
                     throw new FormatTokenError(
-                        char + " flag already set for this field",
+                        "Flag '" + char + "' already set for this field",
                         token.substr(i, 1));
                 }
-                setFlags.add(char);
+                else
+                {
+                    setFlags[char] = true;
+                }
 
                 switch (char)
                 {

    private function parseFlags():void
    {
        var token:Token = lexer.nextToken();
        var setFlags:Set = new Set();
        var char:String;

        if (token.text)

            catch (re:RangeError)
            {
                throw new PrecisionRangeError(
                    "Number following '.' must be in the range 0,20 for exponential formatting");
            }
            break;

