Add debugging functions
Add cleanup-buffer-unsafe