Added node references to function types and pretty-printing to semantic errors