Fixed check when one side of pattern does not have an index, i.e., is
treated as an array of one.
Added method to determine whether connection instance is going in
inverse direction.
Use this method to flip the indices when doing connection sets.