Bugfix for the case a directory is empty