Made clearmod more robust