fix variable expansion in parsing