fix incorrect return of BAD_FORMAT when some field is equal to 0