fixes and clean-up