Gets rid of direct manipulation of globals in spatial layers test.