Add a bunch of debugging and other stuff