JavaScript compatibility improved