Do purge types in clearFile

Issue #334
Issue #282