WirePattern update

Fixed #218, partially implemented #216 (see the issue details; needs testing in real apps before release).