Some bug fixes and a temporary debug demo.