Stability updates

Previously the unique_file was allowing for directories which was
causing a variety of issues since directories cannot hash. Also made a
variety of fixes in the import code