Insert into the correct plan when inserting between plans.

Fixes #16