new example for kernel selection on combined kernels

And some fixes for memory leak/bugs and other minor things