Fix issue #15: Error when retrieving last insert ID