correct behaviour for sub-directories, fixes #1