Fix typo
Fix some errors and warnings in newer gcc compilers (specifically 4.7.2)
- Added missing includes
- Converted `char*` to `const char*` in some cases