fixed extract_headers in fileutils.py