RavenDB-2720 RavenDB-2938

http://issues.hibernatingrhinos.com/issue/RavenDB-2720
http://issues.hibernatingrhinos.com/issue/RavenDB-2938