Corrected compiler errors and warnings.

This have accumulated over the last dozen or so commits.