Fixes #1: incorrect index prevented pbcopy from copying the correct file