Init script: wait for instance to stop

Issue #1115
Makefiles: do not use variables if they are undefined
Merge branch 1115 into next

Review 707 by @mlucy

Closes #1115