Fixing some JavaScript warnings