fix potential uninited variable issue
further warning fixes