Fix build
Update tests
More dynamic allocation