Core/Scripts: Fix the cleanup in 54dbf870b8fc1f0aef1ef95c8786303998762173.