Fix tests and address last comments.