Correct some small bugs