Fixed JavaScript syntax issues