Merge 1.4.x changes into master branch

Plus, conflicts resolved and tests fixed in the final two commits.