Fix function call return type checking