Works with 0.6.5

Did the minimum to get it working with 0.6.5

Probably it needs more of an overhaul, but this seems to work.

Won't with < 0.6.5 with these changes.