Add defensive coding.