Add tests for the diff coverage; fix one hidden unicode bug