Cleaned up a few bugs.