Removed some useless variable assignments
Fixed potential crash with uninitialized variables