Fixed a few bugs in local beam search