More unittests -> bug fixes.