All sorts of fixes
Merge branch '1.0.4-RELEASE'
Updates to merge function