Updated foreign keys and naming issues