Added some debug logging, and triggers are stored in order