Fixed seg fault and others, but still more.

Fixed some stuff, still working on the others.