More fixes and some cleanup.