Fixed some unsigned int issues, SEGFAULT still occuring on linux.