Main fixes as well as defining the grammar