Fix #275 for js backend