Simplified compileFunction a little.