code and gui tweaks and fixes