Fix up compilation warnings and errors.