Fixes for ISSUE-688

Fix and test for ISSUE-688