Add -Wmising-declarations and fix warnings.