Fixed string matching assertion.
Added some internal unit tests.