Fix for index NPE