Fixed bug in insert.