Fix bug in scanDefineInvokation.
removed useless test
Various minor fixes and added another reg test.
Added another reg test.
A couple of more reg tests.
Fixed expected results in test.