Patches to PHPAGI