Add missing prototypes and fix compiler warnings.

This are the missing prototypes and compiler warning fixes form the actual head.