Tests, layout, minor improvements