More Swift improvements and tests.