Cleanup match code.