Merge pull request #199 from josemduarte/master

Exception handling and logging improvements, solves #193