Fix deprecations and warnings in spec output. Add some missing tests.