Fixed automatic MIME type detection when unpacking archives, added tests for content-based MIME type detection.