Fix and testcase for issue #2307
Fix for issue #1965
Fix for issue #2061
Merge branch 'develop' of github.com:/orientechnologies/orientdb into develop