Rudimentary handling of StackOverflowError on top level.