Fixes and further clean-up