Improved Documentation and corrected error management.