Integrate Daniel Green's patches