Fix failures and tighten up the tests a tad more.