fixed a problem with encoding and decoding short id values