Fix small bugs according to test results