Fixed a few bugs. Put in some other more.