https://bugzilla.wikimedia.org/show_bug.cgi?id=55221
--- Comment #1 from Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com --- I changed the behavour of catlib.change_category(). Categories of templates always are always replaced by wikipedia.replaceCategoryInPlace() rather than by wikipedia.replaceCategoryLinks().
The bug ist still remainig for some circumstances: Page.categories() gives categories via api whereas replaceCategoryLinks() works like wikipedia.getCategoryLinks() which is quite different.