fixed errors in lb.cpp from last merge