Added tidyup_p functionality.