fix some compiler warnings about variables used before initialization