Fixed uninitialized variables bug