Fixing protocol equals and making sure exceptions on index are always lo...

...gged
In such a case where there is already a try-catch present, I think catching the NPE is cleaner than having anoter separate check for null.