Fix up tests and encodings