integrate latest changes from 1.6 branch