Fixes #25. Check there is at least one result when executing the
selectKey statement