General updates to scripts and functions