Fix compile warnings for unused add_counter and fix removing of poll funs