fix for #29 Mishandles shell escapes in some cases