Evaluate connection direction when expanding connection between feature
groups - fixes #508
Added unit test for issue 508