Rebinding for compatibility between functions and closures.
bugs#1863, #2048, #2049 and #2050 mentioned