add more missing imports, fix bug in get_text.py