Fix pointer arithmetic