Fix a segmentation fault

There is a bug in clearing an array using memset.

Fix it by assigning correct value to the third parameter of memset.
Merge pull request #617 from mandel59/m59bugfix

Fix a segmentation fault