Try not to leave directories behind with incorrect permissions
Use more fnmatch-like matcher in .stignore (fixes #426)