small regexp/parsing fixes