Initial code dump for addOrder() fix. After this is fixed, then the places that access the order also need updated.