Improve 'exists' test