Fixed deprecated registerListener and trailing space issue of pistachio.