Fixed a minor issue in the clean function