Fix some bugs in nenga package and pw.* packages.