Updates from PR#1191 feedback + unit tests