Fix to memory access in kernels_invoc. Thanks to Ruyman Reyes for the catch.