Improved scripting / minor tweaks, patches etc.