unit tests fixes backported from 1.2 branch for issue #236