FIX: Some memory was freed while it was needed.