Add the finishOpenedActivities.
Improved the error handling of the web element operations.
Minor formatting