Fixed encoding mishaps. Adjusted tests.
Merge pull request #499 from alexindigo/master

Fixed encoding mishaps. Adjusted tests.