Trim spaces from new field and tag names

Fixes #517