Fix rule index validation