Fix bug with worker index not being passed on Jruby or Windows