fix instance bugs.