Various tweaks to reporting and db trigger