Fixed navigation generation

Navigation was wrong when the first item in a .nav file was a directory.
Now fixed.