Bug fix: Use a helper function to set the daily survey count

My previous code had a syntax error because we can't use a variable as a dictionary literal key -- oops.

This also fixes a couple random syntax errors that crept in.