Work around archaic encodings

Closes #304.