Bug fix: exists() pass-by-reference argument returns incorrect value