Remove double-free segfaults