Bugfix: crash when trying to get a directory