Fixed introduced grammar bug, fixed name checking errors