Set of fixes for font processing

I'm working on font/language support detection and this PR is actually a first bunch of (mostly) obvious fixes.