Fix for beta 4 compatibility

Here's the final changes to get all the tests to pass.