replaced '0' with 0 in memset calls in thread functions