Improves the implementation of is_element_present and removes extra
blank line.