Added try/except/finally statement. Closes #3