Added test for #976
Fixed #976 by moving part of the expression transformer setup from the normal method block handling and making it more generic so the code handling specified method blocks can use it as well
Fixed another test that was affected by the changes for #976