Fix compilation warnings.

These changes were necessary when compiling with warnings as errors.