Fixes and clean-up