Fix behaviour of expect.empty() function