CompiledFunction.asContext was returning the wrong function