Fix JavaScript issues (cont)