Update database triggers. With previous 2 commits fixes #125.