Fixes and a test script.