Fix some issues in tests.

This makes the tests pass reliably on my machine, and stops failing tests from spewing binary all over my terminal.