RavenDB-1600 and invalid condition fix