Fix some debug codes