Fixing pointer addition errors( thanks C. Roggia