Improve robustness with respect to exceptions.
Improve robustness with respect to exceptions.

askogvold/jtk,dhale/jtk,MinesJTK/jtk,voltnor/jtk,askogvold/jtk,chrisengelsma/jtk,voltnor/jtk,voltnor/jtk,ctrueden/jtk,voltnor/jtk,askogvold/jtk,MinesJTK/jtk,ctrueden/jtk,MinesJTK/jtk,askogvold/jtk,dhale/jtk,dhale/jtk,ctrueden/jtk,chrisengelsma/jtk,chrisengelsma/jtk,ctrueden/jtk