Multiple tweaks and bug fixes