some small fixes and clean up