Merged from upstream: fix bugs from klim8d and oddstr1