Grammar and syntax cleanup