Fixed crash when wrong arguments to a function are received