Add some tests for the error code part