fix bugs in instance task + test
Merge remote-tracking branch 'origin/master'