fix as() tests

My pull #412 conflicted with #656 and broke the tests. Here's the fix.