Fixed some bugs from last commit.

Should have run the tests.