Some --encoding issues fixed (see #664).