Fix implicit declaration warnings,
Fix warning for printf format.