Fixed uninitialized memory bug