fixes, tweaks and cleanups