style and some error fixes which may help to use with more then one network adapter