Removed old code.
More cleanup. Bugs fixed.