Some fixes.
All unittests pass.

I have to add some more and check if the heisen bug is really gone.