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