- Moved notifications outside of the transaction, so the transaction will be committed before notifications are sent out, and hence notifications will reflect the new status, not the old one.
- Suppress the space after the (Resolution code) thing, if there is none. Caused an extra space character in the notifications email