Added error checking for the case in which the data store is empty.
Changed the semantics of poll.