Corrected a bug whereby non-directories would be walked