Fixed an issue for mocked methods with optional parameter