Fix dynamic kernel argument indexes.
part of #190.