Fix parsing of generic types