fix for Issue #5: Properly handle $this