Rewritten fix for LB, unrelated LB code removed