 
   fillActions: (step, index) =>
     # fills up steps and actions such that step and index are valid
-
-    for i in [0..step-1]
+    for i in [0..step]
       if not @steps()[i]?
-        @steps.setIndex(step, new Step({}))
+        @steps.setIndex(i, new Step({}))
 
     # actions can arrive out of order when doing parallel. Fill up the other indices so knockout doesn't bitch
     for i in [0..index-1]

      @status() == "success"

    @failed = @komp => @status == "failed" or @status == "timedout"

    # Expand failing actions
    @minimize = @komp =>

    actions: []

  constructor: (json) ->
    json.actions = if json.actions? then (new ActionLog(j) for j in json.actions) else []
    super json

class Build extends HasUrl
  constructor: (json) ->

    json.steps = if json.steps? then (new Step(j) for j in json.steps) else []

    super json,
      body: null
