more bug fixes in some encodings