Refactor code to determine file types
Fix typo
Only replace first instance of root path
Fix directory walking bug