Fixed a bug when mocking failed.

Signed-off-by: crynobone <crynobone@gmail.com>