Fix -Wstrict-prototypes warning
Fix -Wold-style-declaration -Wold-style-definition warnings
Fix more warnings
Cleanup debug code