Making the final changes. Fixing a few bugs.