some minor improvements regarding text encoding