Cleaned up build warnings, mostly by adding function prototypes.