Add missing prototypes and fix compiler warnings.
Fixed a copy and paste mistake.
Fix printexceptions test, mostly
Fix printexceptions & test.sh