Update code comments and fix typos