Repair beta labs

The javascript code was trying to look at roots[0], but due to the unset()
Flow could output a JS object rather than an array.  This adjusts the
code to log that something went wrong along with forcing the output to
always be 0-indexed.

I don't think this will fix the root of the problem, but should cause it
to happen in a more obvious way.  The root of the problem is that $posts[$alpha]
was not set, which I'm almost sure is going to be a problem with writing to
master and reading from the slave.

The read/write master/slave thing will be addressed in a followup assuming thats
actually the problem.

Bug: 68531
Change-Id: I2f9e167593f121a0593cc14f283ad36e7d92d794
Merge "Repair beta labs"