MRP: Added casts to malloc() results
MRP: Renamed typedef structure

Renamed typedef structure to avoid a conflict with a member name.