Handle overapplied functions correctly.