Fix exception no documents provided

I added a test and a fix for the problem with exception on update with empty doc list (issue #811).
Reviews and suggestions are welcome.