Fix the prepend logic for the scripts