Fixed some issues with database commits.