Check assert_total is defined before evaluating

Otherwise it goes bad when defining it! This is just a bit of a hack to
make sure we fully evaluate under assert_total, and probably ought to be
done a bit more tidily later.