Bug fixes and removed rest of old stuff.