Return type stability fix

Missing type specification in zeros calls, causing inconsistent return type when T != Float64.
Merge pull request #9086 from GunnarFarneback/patch-1

Return type stability fix