Fixed a mock issue with spec testing.