Javascript: fixes