Fix JS errors due to bad indicies from core code.

"undefined" indicies get passed to
https://github.com/openlibrary/bookreader/blob/master/BookReader/BookReader.js#L1780-L1788
which results in NaN being used as an index...  Which in turn causes much fun...

Have to check the results being defined any time we access something via indicies...