Fix problems with triggers and do cleanup.
Add necessary files.