Catch when $today is not defined.
Cleaned up the transaction stuff for issue #1