Major Bug Fixing.

This mainly includes correcting packages and imports and removing
useless stuff already added by geology.