Stabilize tests.

Tests would randomly fail when the current directory somehow changed while running tests.