Fix #2 and #3: Fixes for multiple instances