Fix lastworktime reading.

Only set lastworktime if we did any work.