Rewrite error test