Fixed the insert problem with the new database structure.