OAK-1570 merge with latest trunk and minor fixes