Fixed some compiler errors and warnings.

16 files changed