Trim fields before setting them