misc fixes and clean-up