Added attribute checking to clean-up script.