Completed Clear sample, fixed some Release mode compile bugs