builtin: check params for NULL.

Adds some safety and also eliminates some warnings.