more bug fixes for code tokens