Added support for optional object expectations