Fix layout
Fix tests
Merge branch 'master' into cas