Type inference for functions.

Got rid of some == NULLs.