(#1961) - typecheck opts.keys to be an array