Fixed bug in exists() method.