Fix some issues found in test