fix tests, add CLI opts