more clean-ups and fixes