types+grammar: fixes mistakes in ch4, closes #205, closes #206