Cleaned up, and did quite a few changes and fixes.