fix bug in casting from mongo doc back to a snapshot