Scripts - minor bug fixes