Fixed problem with null fields.

If you didn't enter a value in a non-required field this was throwing a
nullpointerexception. The solution is ugly (for now).