types+grammar: closes #193, closes #195