Fix some warnings
Add missing header file
Fix implicit pointer cast warnings