Added either encoding and tests
Fixed test failures