KERNEL: if a kernel is invalid give an error!

(cherry picked from commit 5102dc330e1f65f752e72794d1355f710e43c160)
Merge branch 'v2.0' into belfast
Merge remote-tracking branch 'origin/belfast' into belfast