Fixed some C-style code (type punning, type casts).