Fix problem with upper case / lower case foreign keys