Beautify code listings and fix typos