Correct typecasts on *alloc

Picky compiler