Add partial duplicate order handling. Fixes #299