Fixed python 3 encode/decode error: fixed #28