Added doxygen comments and errno values.