fix tests and cleanup.