Fix ClickElement and auto-format code