Still working on fixing the segfault bug.