TESTS: regression tests added for issues #770 and #778.