Fixing a couple minor bugs.

I can't believe how few bugs there were after coding all that.