some tweaks and fixes