fixed some warnings due to initialization order and a potentially uninitialized value.