Fix bug in sanity tests.

Was using -r when I meant -w.  Now we check both.
This takes care of GH #150.  Thanks @bkysela for
bringing this to my attention.