Adding some changes that should have made it into the previous commit.