Changed memset statements, saw potential bug

Untested