Fix memory bug in Instance