Changed error codes as -1 is the same as 255 because of 8 bit limits. Moved error code tests up the chain.
Silenced standard output for exception tests.