Done small fixes which have been overseen during last refactoring
session. Fixed the unit tests.