BugFixes for UnitTests