correctly remove empty shipments; remove unreachable code