Improved some bugs on detecting redeclarations (particularly with function types) and fixing a problem of false 'undeclared identifier' errors being generated by procedure calls.