Fixed the debug case of #831