Fixed a couple of bugs from the previous commit.