Fix entity version handling