Fix a few debug codes