Fixed a bug with the hash algorith keeping file handles open.