Allow custom config and fix tests