Fix NULL ptr dereference. Fix compile warnings due to changes in netdevice interface.