Corrected definition of clearchanges