small fixes and cleanup