Fixed some bugs when selecting a different type of object in puppeteer.