PLFENG-1886: fix gadget bugs