Added the possibility to get the last inserted id.