Fix frozen string issues with encode!
This resolves issue #138