Fixed uninitialized variable bug