Foreign keys and fix views