Removed some unneeded code, and improved the error message for Element Not Found errors.