Removed a lot of pointers and fixed file corruption