Fix unicode error, add tests, but this does not work yet.