fix issue with repeated fields, closes #4