Fix a number of exception problems in JMS2