Remove leftover debug print, add missing terminate calls