Improve tables selection in kernel/static/bgp protocols. Fix wrong type fields in Kernel