Fixing insertion into database.