Pr/571

rebased against master