Added eval to protect against not being able to read the directory
More tests to increase coverage
Moved code protection to surrounding if