Use `longest` instead of `max`

This fixes issues with npm due to a stupid deeply nested dependency.