Clean up exception handling, fix crash on buggy Marmalade Mac STL