Exception catcher

These patches makes code simple and gives a standard behavior for exceptions.