Fixed use of wrong Exception in try/except statement.