Fixed some recursive database issues.