Let's write some negative code. Remove your fix attempt, it was causing an error, thats why all other scripts stopped working.
$container.active(false);
Then remove the next line. Here first item of the accordion was expanded:
$trigger.first().addClass('active').next().show();