Fixed error codes, and added a manual page