Fixed test that did not shut down correctly
Minor fix to handle issue where result is null on cursor