Small parser fixes + code clean-up