Correct pointer typecast