Don't create advised function more than once
Add test for Issue #293