Amend database configuration for Tools
Fix warnings for undefined indexes and variables