Fix an issue that could occur when setting multiple expectations.