Replaced some uses of ExpectedException with 'assertRaises'.