Fix JavaScript issues - use jQuery properly.