Fixed pre-remove script