Added function type resolving and upgraded return type expressions.