Fixed assert after hibernate
Fixed work with updates