Fixed unapplying for functions.