FIX: Fix segfaults