Fixes typo, handles adjustable order without order_id

fixes #5582
Fix ZeroDivisionError. Fixes #5521