                         .concatMap(identity)
                         .filter({role: "director", state: "ready"})
                         .count()
-                    num_replicas: table_config('shards').concatMap(identity)("replicas").count()
+                    num_replicas: table_config('shards').concatMap(identity)("replicas").concatMap(identity).count()
                     num_available_replicas: table_status('shards')
                         .concatMap(identity)
                         .concatMap(identity)
-                        .filter({role: "replica", state: "ready"})
-                        .count()
+                        .filter( (assignment) ->
+                            assignment("state").eq("ready").and(
+                                assignment("role").eq("replica").or(assignment("role").eq("director"))
+                            )
+                        ).count()
                     tables_with_directors_not_ready: table_status.merge( (table) ->
                         shards: table("shards").indexesOf( () -> true ).map( (position) ->
                             table("shards").nth(position).merge

            @$('.popup_container').hide()

        render: =>
            @$el.html @template
                status_is_ok: @model.get('num_available_replicas') is @model.get('num_replicas')
                num_replicas: @model.get 'num_directors'
                num_available_replicas: @model.get 'num_available_directors'
                num_non_available_replicas: @model.get('num_directors')-@model.get('num_available_directors')
                num_non_available_tables: @model.get 'num_non_available_tables'
                num_tables: @model.get 'num_tables'
                tables_with_replicas_not_ready: @model.get('tables_with_directors_not_ready')

            if @display_popup is true and @model.get('num_available_directors') isnt @model.get('num_directors')
                # We re-display the pop up only if there are still issues

                num_non_available_tables: r.row("tables_with_directors_not_ready").count()

            driver.run query, (error, result) =>
                ###
                console.log '----- err, result ------'
                console.log error
                console.log result
                ###
                if error?
                    #TODO
                    console.log error
