Bugfix: getDirectory of '/foo' should return '/' not ''.