More work on the compat wrapper. Doesn't compile yet, but almost there.