Fixed warnings
Fix segfaults at startup