Fixed unused and uninitialized variables