Added retrieval of the result type for functions.