Fix legacy_order undefined variable notice.