Fix more error; Add some debug code