Automatic merge from submit-queue Fix an 'index out of range' panic when setting capabilities. cc @yujuhong @feiskyer