Caught and corrected a few bugs thanks to testing.