Fixing a few bugs.