Fixed a big bug in encodeAddress