Fix bugs in connectSeparatedPoints implementation. Add test.