Made some minor corrections on instance related code