fixed few bugs in sentence processing