Fixes insertion bug