When I were running a script once, I was having path problems, space in paths to be more specific. I solved the spaces issue by using
"\"$var\""
I dont know if it will help you though, but I reckon its worth a try :)
EDIT: please let me go check my old code though because i need to see exactly what all was concatenated in $var.
EDIT2: Please disregard, I was thinking about feeding another program a quoted string and the above was my solution. I am sure it will not work for your situation.