Change to new syntax, add tests.