add parsing tests and make some fixes