Updated scripts based on issues found