Update to latest changes and add some tests