Fixes for SEQWARE-1678 and SEQWARE-1679
Additional fix for SEQWARE-1679
Tests for SEQWARE-1678 and SEQWARE-1679