Fix array elemMatch relative rewrite logic