Handle optional error flag.
Added definitions of *ENSURE-... functions to phase 2."

These functions all have prefix * to avoid clobbering existing
functions.