Improved custom method self parameter detection.