A few bug fixes related to the last commit.