Raven db 2282

issues 2327 and 2294 fixed
2282 fixed but not finished