PM2 implementation and query fixes.