Fixing read_dir issues (closes #586)