Fix ~ that gets added to URI