Fix whitespace handling and buffer delete.