Fixing bugs in unicode character class encoding/decoding