Fix bug in compilation when running multiple scripts