Fixed key problems.

Added a few missing primary keys. Also changed the REFERENCES to use the default on delete so that they would throw referential integrity errors if the foreign key gets deleted.