Fix broken operator precedence logic.
Initialize pointer type objects with values of appropriate types.
Fix Undefined behavior

The value of a pointer to an object whose lifetime has ended is used (C99p6.2.4).
Fix Undefined behavior.

An array subscript is out of range (C99p6.5.6).