RavenDB-1118

Based on 2.5 branch