Documentation finished. Improvements in error checking and return values
of methods.