Code merge for upgrade to 1.7