Fixes #1874: Added support for multiple instances