script tweaks, object lifecycle fixes to prevent instability on errors