Attempt to fix insertion bug, still more to do here.