REGRESSION: reapply several pull requests that were lost in 1.2 release