Move middleware to correct place.
Fix 'comparison of Date with nil failed' when reports missing a start/finish date.