Fixed a few bugs, matching algorithms should work now.