1.5.3 backports

cherry-picked bugfixes from master for a requested 1.5.3 release.