fix errors in amavis rewrite