Bugfixes for multiple instances