improved the @return slot in several documents, removed redundant tests, improved length(0) behaviour