Updated try catch blocks
Added assert statements where necessary