Fixed minor bugs in previous commit.