Fixed a bug of AddMethods with private methods