Minor fixes to the type checking of function call