Fixed subtle bug when testing for existence.