Issue #5986: Refactor constructors in cocostudio extension and fix issues