Fixed bugs, added instance clone and copy