Fix pathname gotchas