Patch getElement() issue with returning a null index value