Correctly define $defaults as an array.

Additionally, invert the `if` condition to unnecessary avoid early
return.
Merge pull request #1 from davexunit/master

I personally prefer to return as soon as possible in hooks, to avoid nesting too much, but in that case, works fine either way ;)