Merge "Fix two IndexOutOfBoundsException crashes." into oc-dev