More unit tests. More fixes.