Add missing database result error checks

Closes #2.