Fix entity saving