Further changes to make tests self-contained