Now only return error code when there is actually an error code returned.