Update to new style classes, fix for issue #1110

Check the issue for more info.