Fixed format and added tools for debugging