Fixes #289, Incorrect list generation. Also turns off debug for json renderer.
Fixes failure to convert string to number in call to toc()
Fixes #291 ... again.