Shopify Discount Functions: Duplicate line items in checkout

EDIT: I now noticed that this always happens when the discounted line item comes after the non-discounted one (of the same product variant) in the cart. When the discounted line item comes before, there is no additional line in checkout. It seems like - when going to checkout - Shopify takes the lines from the already splitted cart and applies function discounts to the first line item with the specified variant ID and splits the line if necessary. I still got no solution for this, since I am not sure if I can tell Shopify to always put the discounted line first. Anyways, the behaviour seems not optimal to me.