Merge pull request #226 from trustmaster/master

WirePattern fixes
Fixed #228 and added a test for it.