Exceptions improvements, bugfixing

Deal with C++ exceptions;
Improve process class;
A few bugs were fixed;