Fix segfaults! This resolves #1