fix bug if ByValue types are explicitly used in struct fields