Fixed potential crash with uninitialized variables