Fix function call context

Note: I haven't tested this