Added type checking for first class function types.