Merge new 1.2.7 functionality back to 1.1.5 version