Fixed a bug and removed old stuff.