Fixed a bug in manipulation of methods