Fixed segfaulting on empty directories in Linux.
Merge pull request #3 from meklu/master

Fix segfaulting on empty directories