Fixed a bunch of little bugs.