FIX: Double free errors causing instability and crashes in multiple situations.