Bugfix get form values

This addresses #360. Fixes a bug with getting form values for radio inputs, and introduces a minor optimization to avoid processing the same form fields more than once.