Fix bug that caused method caching to throw an 'invalid arguments' error