More fixes, cleanup