Fix weird pointer arithmetic