Nested conditionals

Nesting check for `if err != nil`, only needs to be tested once.
Merge pull request #80 from richierichrawr/master

Nested conditionals