src: fix two syntax errors

First was an improper comparison with bool to int. Second was to "throw
error" instead of "throw new Error".