Improve formatting of scripts and test files