Fixed bug in javascript instantation patterns