A couple of changes to make the script run cleanly