[cvs-nhc98] Remove bug in type checker and addition of some error mess