Fix bug in hasNext when no result for a key is returned
Code reformat per request of project owner.
Merge pull request #592 from ctcttest/master

Fix bug in hasnext when no result(s)