Fixed exception handling

We now take into account that not all browsers have a stack method