Strips whitespace from before and after necessary fields

Fixes Issue 292