Fixed memory leak caused by caching invalid MethodDescriptors

#1801