directories are either a Hash or an Array of Hashes

this should fix #535