Fixed a bug in method checking.