Change the parameters type from 'string' to 'path' (automatic expand of ~)
Remove the expand_path in other places.