Added some primary keys, fixed an error