Rebased against latest master and resolved conflict