Fixed semantics bugs.