Bunch of fixes + Added monitoring of multiple processes sharing same name

- Closing streams properly in finally block
- Catching unhandled exceptions