Fixes issue #64. Uses the same fix as in pull request #68 but adds a test to verify that the change works and that nothing else is broken
fixed issue #64 w/ tests
Thank you, although please note I applied some changes to your pull request (your test still passes though.) I don't think you need to do the encoding twice that you're doing.