Added try-catch blocks to the test classes