Improved test for #1243 to include methods within methods
Fix for #1243 now also takes care of methods within methods