Fix errors in semantics

Change-Id: I79a356423cf9241bf14525870b14401bc614e807