Fix encoding issues

Should fix issues raised in #14