Bug fixes for the previous commit.