Fix error with similar table names across databases