Fix #354 - Expand ~ and env variables in paths (settings)
Handle possible exceptions
Merge pull request #356 from my-personal-forks/fix-354-expand-user

Fix #354 - Expand ~ and env variables in paths (settings)