Fix malloc weirdness