Add compatibility with PHP 5.3

Fix for error with PHP 5.3: Using $this when not in object context at line 60.