Simplify a bit the code.
Fix inverted conditional.

Also document function return value. It's kinda misleading,
my bad.