Resolve segfaults