Fixed bugs in blue allocation logic