Uar 599 UAR 594

Note, there were two commits as squashing results in a merge conflict. Contains fixes for UAR-599 and UAR-594