Reduced code nesting.
Add test for no db results.