Rebased pull request 4 with master.