parser improvements + bug fixing + tests