Port the new code recently added to master