fixed error parsing address, rewrote re-encoder, minor improvements