make sure that directories are actually a Hash

this should fix #535