Cleanups and make sure that a FunctionCompiler is instantiated.
Comments. Also be more defensive.
Comments and cleanup.