Return empty stream if index cannot be found rather than throw exception.

Also includes some minor code reformatting.
Merge remote-tracking branch 'origin/master'