Fixed foreign keys to support multiple keys