Fix for zsh issue

@graemechristie  @davidfowl 
Merging the changes from kvm repo to home repo so that the fix is in the kvm installed by homebrew
Are zsh arrays 1-indexed? This will break in bash because the arrays are 0-indexed there.