Fixed encoding. All unit tests passed.