Fixed encoding mishaps. Adjusted tests.