Fix some minor bugs in the previous commits.