Pass filename as `name` instead of passing full path as `dir`
Make sure `alias_path` starts with '/' and add non-empty paths only
Merge pull request #1 from yous/patch-not-a-directory

Patch not a directory