Fix bug introduced when merging DB code.

introduced in commit:a484bbc42b691621c1a6424e39c7233791efc24e
refs #97
Use "errexit" option to prevent continuing with unexpected behaviour.

refs #97