Performing script cleanup