Fix bug with $or conditions