Nested conditionals

Nesting check for `if err != nil`, only needs to be tested once.