FL-1627: additional merge script fixes and improvements.