some parser and minor fixes