[PATCH] RPZ: bug fix and code update