General improvements for numerous scripts