Fix some usages of snprintf, and clarify a couple variable names.