Fixed a small issue with removing global instances on a vanilla Linux machine.

This was working all fine on our development machine, but definitely
not a vanilla one. Whatever the case, the fix simply consists of
delaying the removal of global instances after we have created our
application. It is actually better this way!