Additional test + another edge-case fix for #813
Merge branch 'Fix-813-758' into devel