Fix Trac #745: improve error recoevery for type signatures