Python: ignore encoding errors; minor tweaks