Reported by: naddy
not based on the patch offered (I already had prepared diffs more than one week ago, but had no time to perform the commit). I choose to use my patches instead of those from the PR, since they seemed even more correct ;-)
Initialize a few variables to 0.