Correct typecasts from *alloc

Picky compiler issues