Merge master changes into 1.9

The Master branch is pretty much the 1.9 version, with additional fixes.