Merge fixes for 1.7.1 release from testing branch