A few bug fixes.

The log functionality was broken by the new database config
implementation (as it has to get it's own db adapter). This is now
fixed.

Retemping a shift in the past was passing the shift's ID, not the temp's
ID. This is now fixed.