check for not result instead of result === undefined

Fixes #47.