Fixed segfaults and other changes. IT'S ALIVE!!!