Fix buildslave init script errors saying "buildmaster"

Also, change `${i}` to `${index}` for consistency with surrounding code.