Rename max_subs to max_submissions in functions.

Avoids confusion over global and local variable names.