Fixed misc issues found during test run