fixed error logging in tests