Fixing pointer errors, header issues