Allow standalone usage and fix tests.