fixed bugs in type extractor