Minor bug fixes to previous commit.