improve error messages produced by _expect()
add a todo test reported by @y_imaya