Correct minor bugs