fix a few more encoding-related issues