Resolves #17

Updated the run method to check for array key existence before trying to use it.
Merge pull request #18 from davidyell/patch-2

Resolves #17