Error codes

Added error codes to all the checks, as per Issue #39.