Those templates are junky and should be rewritten in Lua probably. The support for pp= is quite broken; it puts the same pp form in all numbers and genders.