fixed bug in semantic constraints check

changed in getNextWordSemantics to update lastVB instead of prevVB.