Fix touching freed memory