fixes to grammar including if-then-else