fix parsing of type declarations