Fixed bugs in shipping logic.