Fixing bug

Fixing bug where the insert method always returns 0,
even after a successfully insetion, rather than the id
of the inserted element.