fixed various bgp null-pointer bugs introduced by overhaul